<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
 * Assets Helper
 * Author : Yana Supriatna
 * Author email : yana.soup@gmail.com
*/

/**
 * JQuery JS
 * 
 */

if ( ! function_exists('assets_url'))
{
	function assets_url()
	{
        return base_url().'assets/';
	}
}

if ( ! function_exists('load_style'))
{
	function load_style($filename)
	{
        return '<link rel="stylesheet" href="'.base_url().'assets/'.$filename.'.css" />'."\n";
	}
}

if ( ! function_exists('load_js'))
{
	function load_js($filename)
	{
        return '<script src="'.base_url().'assets/'.$filename.'.js"></script>'."\n";
	}
}

if ( ! function_exists('jquery'))
{
	function jquery($minified = true)
	{
	   if ($minified)
        return '<script src="'.base_url().'assets/lib/jquery-1.7.2.min.js"></script>'."\n";
       else
        return '<script src="'.base_url().'assets/lib/jquery-1.7.2.min.js"></script>'."\n";
	}
}

if ( ! function_exists('jquery_ui'))
{
	function jquery_ui($minified = true)
	{
	   if ($minified)
        return '<script src="'.base_url().'assets/lib/jquery-ui/js/jquery-ui-1.8.22.custom.min.js"></script>'."\n";
       else
        return '<script src="'.base_url().'assets/lib/jquery-ui/js/jquery-ui-1.8.22.custom.min.js"></script>'."\n";
	}
}

/**
 * JQuery Mobile Stylesheet
 * 
 */
if ( ! function_exists('jqm_css'))
{
	function jqm_css($minified = true)
	{
	   if ($minified)
        return '<link rel="stylesheet" href="'.base_url().'assets/lib/jqm/css/themes/default/jquery.mobile-1.1.0.min.css" />'."\n";
       else
        return '<link rel="stylesheet" href="'.base_url().'assets/lib/jqm/css/themes/default/jquery.mobile-1.1.0.css" />'."\n";
	}
}

/**
 * JQuery Mobile JS
 * 
 */
if ( ! function_exists('jqm_js'))
{
	function jqm_js($minified = true)
	{
	   if ($minified)
        return '<script src="'.base_url().'assets/lib/jqm/js/jquery.mobile-1.1.0.min.js"></script>'."\n";
       else
        return '<script src="'.base_url().'assets/lib/jqm/js/jquery.mobile-1.1.0.js"></script>'."\n";
	}
}

if ( ! function_exists('jqm_plugin'))
{
	function jqm_plugin($jsfile)
	{
        return '<script src="'.base_url().'assets/lib/jqm/'.$jsfile.'.js"></script>'."\n";
	}
}


if ( ! function_exists('rgraph_core_js'))
{
	function rgraph_core_js()
	{
	    $js = '<script src="'.base_url().'assets/lib/rgraph/RGraph.common.core.js"></script>'."\n";
	    $js .= '<script src="'.base_url().'assets/lib/rgraph/RGraph.common.dynamic.js"></script>'."\n";
	    $js .= '<script src="'.base_url().'assets/lib/rgraph/RGraph.common.effects.js"></script>'."\n";
	    $js .= '<script src="'.base_url().'assets/lib/rgraph/RGraph.common.tooltips.js"></script>'."\n";
	    $js .= '<script src="'.base_url().'assets/lib/rgraph/RGraph.common.key.js"></script>'."\n";
        return $js;
	}
}

if ( ! function_exists('rgraph_chart_js'))
{
	function rgraph_chart_js($js_file)
	{
	    $js = '<script src="'.base_url().'assets/lib/rgraph/'.$js_file.'.js"></script>'."\n";
        return $js;
	}
}


